package com.help10000.rms.mvp.presenter

import com.amir.common.api.CustomObserver
import com.amir.common.beans.BaseResult
import com.amir.common.mvp.model.Model
import com.amir.common.mvp.presenter.BasePresenter
import com.amir.common.utils.Constant
import com.amir.common.utils.SPUtils
import com.help10000.rms.mvp.view.CommonView

class ApplyEntryPresenter(view: CommonView<BaseResult>) :
    BasePresenter<CommonView<BaseResult>>(view) {

    /**
     * 收款
     */
    fun applyInit(cmpyCode: String?) {
        val AccessToken = SPUtils.getString(Constant.AccessToken)
        val applyInit = Model.getServer().applyInit(AccessToken, cmpyCode)
        Model.getObservable(applyInit, object : CustomObserver<BaseResult>(mvpView) {

            override fun success(t: BaseResult) {
                mvpView?.onDataSuccess(t)
            }
        })
    }


}